class Solution1 {
    public int removeDuplicates(int[] nums) {
        int left=0;
        int right;
        for ( right = 1; right < nums.length-1; right++) {
            if(nums[right] != nums[right-1]){
                nums[left] = nums[right];
                left++;
            }
        }
        return left;
    }
}